package com.luobu.javaee.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.luobu.javaee.domain.DocShare;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ArchiveShareMapper extends BaseMapper<DocShare> {

    @Insert("insert into archive_share(archiveId,userId) values(#{archiveId}, #{userId})")
    void insert(Long archiveId, Long userId);

    // order by create time
    @Select("select archiveId from archive_share where userId=#{userId} order by create_time")
    List<Long> selectArchiveIdByUserId(Long userId);
}
